<?php defined('InShopNC') or exit('Access Invalid!');?>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3><?php echo $lang['nc_member_level_manage']?></h3>
      <ul class="tab-base">
        <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_manage']?></span></a></li>
        <li><a href="index.php?act=member_level&op=level_add" ><span><?php echo $lang['nc_new']?></span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>

  <table class="table tb-type2" id="prompt">
    <tbody>
      <tr class="space odd">
        <th colspan="12"><div class="title">
            <h5><?php echo $lang['nc_prompts'];?></h5>
            <span class="arrow"></span></div></th>
      </tr>
      <tr>
        <td><ul>
            <li>会员消费积分比列请在&nbsp;<a href="index.php?act=operation&op=setting">运营&gt;基本设置</a>&nbsp;中处理</li>
            <li>当前消费与积分兑换比列为：<span style="color: red">1/<?php echo C('points_orderrate')?>=<?php echo intval(1/C('points_orderrate'))?></span></li>
          </ul></td>
      </tr>
    </tbody>
  </table>
  <form method="post" id="form_member">
    <input type="hidden" name="form_submit" value="ok" />
    <input type="hidden" name="act" value="member_level" />
    <input type="hidden" name="op" value="level_del" />
    <table class="table tb-type2 nobdb">
      <thead>
        <tr class="thead">
          <th>&nbsp;</th>
          <th class="align-center">渠道名称</th>
          <th class="align-center">等级名称</th>
          <th class="align-center"><span fieldname="logins" nc_type="order_by">最小积分</span></th>
          <th class="align-center"><span fieldname="last_login" nc_type="order_by">最大积分</span></th>
          <th class="align-center">渠道价名称</th>
          <th class="align-center">会员折扣</th>
          <th class="align-center">操作</th>
        </tr>
      <tbody>
        <?php if(!empty($output['memberLevelList']) && is_array($output['memberLevelList'])){ ?>
        <?php foreach($output['memberLevelList'] as $k => $v){ ?>
        <tr class="hover member">
          <td class="align-center"><input type="checkbox" name='del_id[]' value="<?php echo $k; ?>" class="checkitem"></td>
          <td class="align-center"><?php echo $v['level_name'];?></td>
          <td class="align-center"><?php echo $v['member_name'];?></td>
          <td class="align-center"><?php echo $v['min_points'];?>&nbsp;(<?php echo intval($v['min_points']*C('points_orderrate'))?>)</td>
          <td class="align-center"><?php echo $v['max_points'];?>&nbsp;(<?php echo intval($v['max_points']*C('points_orderrate'))?>)</td>
          <td class="align-center"><?php echo $v['price_name'];?></td>
          <td class="align-center"><?php echo $v['discount'];?></td>

          <td class="align-center">
            <a href="index.php?act=member_level&op=level_edit&level_id=<?php echo $k; ?>"><?php echo $lang['nc_edit']?></a> |
            <a href="index.php?act=member_level&op=level_del&level_id=<?php echo $k; ?>"><?php echo $lang['nc_del'];?></a>
          </td>
        </tr>
        <?php } ?>
        <?php }else { ?>
        <tr class="no_data">
          <td colspan="11"><?php echo $lang['nc_no_record']?></td>
        </tr>
        <?php } ?>
      </tbody>
      <tfoot class="tfoot">
        <?php if(!empty($output['memberLevelList']) && is_array($output['memberLevelList'])){ ?>
        <tr>
        <td class="w24"><input type="checkbox" class="checkall" id="checkallBottom"></td>
          <td colspan="16">
         <label for="checkallBottom"><?php echo $lang['nc_select_all']; ?></label>
            &nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn" onclick="if(confirm('<?php echo $lang['nc_ensure_del']?>')){$('#form_member').submit();}"><span><?php echo $lang['nc_del'];?></span></a></td>
        </tr>
        <?php } ?>
      </tfoot>
    </table>
  </form>
</div>
<script>
$(function(){
    $('#ncexport').click(function(){
    	$('input=[name="op"]').val('export_step1');
    	$('#formSearch').submit();
    });
    $('#ncsubmit').click(function(){
    	$('#formSearch').submit();
    });	
});
</script>
